package com.strelitzia.vo;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @create 2023/12/14 15:35
 */

@Data
public class RegForm {
    @NotEmpty(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9]{5,18}$", message = "用户名必须是6-18位数,以字母开头,不包含特殊字符")
    private String username;
    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9]{7,18}$", message = "密码必须是8-18位数,以字母开头,不包含特殊字符")
    private String password;
    @NotEmpty(message = "邮箱不能为空")
    @Pattern(regexp = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*", message = "请输入正确的邮箱")
    private String email;
    @NotEmpty(message = "验证码不能为空")
    private String code;
}
